package com.atguigu.srb.core.controller.admin;


import com.atguigu.srb.base.result.R;
import com.atguigu.srb.core.pojo.entity.LendItem;
import com.atguigu.srb.core.service.LendItemService;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 标的出借记录表 前端控制器
 * </p>
 *
 * @author Atguigu
 * @since 2023-01-04
 */
@RestController
@RequestMapping("/admin/core/lendItem")
public class AdminLendItemController {
    @Resource
    LendItemService lendItemService;
    @ApiOperation("投资记录列表")
    @GetMapping("listByLendId/{lendId}")
    public R list(@PathVariable("lendId")String lendId){
        return R.ok().data("items" , lendItemService.list(Wrappers.lambdaQuery(LendItem.class)
            .eq(LendItem::getLendId,lendId)));
    }

}

